home *** CD-ROM | disk | FTP | other *** search
- * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
- * The C++ Answer Book */
- * Tony Hansen */
- * All rights reserved. */
- include <process.h>
- include <debug.h> /* DELETE */
- / delay for a given amount of pseudo-time
- oid process::sleep(unsigned long t)
-
- if (debug) /*DELETE*/ cerr << "process" << this << "::sleep(" << t << ")\n";
- if (debug) /*DELETE*/ cerr << "\tt_curtime == " << t_curtime << "\n";
- if (mustrecurse())
- sleep(t);
-
- else
- {
- // remove this from other lists
- // and place back on run queue
- // ordered by new desired time
- wakeup(t);
-
- // save and schedule another process
- if (t_thisprocess == this)
- if (!contextswitch())
- schedule();
- if (debug) /*DELETE*/ cerr << "<<<< process" << this << "::sleep(" << t << ")\n";
- }
-
-